<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>视频管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/cms/video/?category.id=${video.category.id}">视频列表</a></li>
		<shiro:hasPermission name="cms:video:edit"><li><a href="<c:url value='${fns:getAdminPath()}/cms/video/form?id=${video.id}&category.id=${video.category.id}'><c:param
		name='category.name' value='${video.category.name}'/></c:url>">视频添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="video" action="${ctx}/cms/video/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
		<li><label>栏目：</label><sys:treeselect id="category" name="category.id" value="${video.category.id}" labelName="category.name" labelValue="${video.category.name}"
					title="栏目" url="/cms/category/treeData" module="article" notAllowSelectRoot="false" cssClass="input-small"/>
			</li>
			<li><label>标题：</label>
				<form:input path="title" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
			    <th>栏目</th>
				<th>标题</th>
                <th>视频地址</th>
				<th>更新时间</th>
				<th>备注信息</th>
				<shiro:hasPermission name="cms:video:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="video">
			<tr>
                <td><a href="javascript:" onclick="$('#categoryId').val('${video.category.id}');$('#categoryName').val('${video.category.name}');$('#searchForm').submit();return
                        false;">${video.category.name}</a></td>
				<td><a href="${ctx}/cms/video/form?id=${video.id}">
					${video.title}
				</a></td>
                <td>${video.url}</td>
				<td>
					<fmt:formatDate value="${video.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${video.remarks}
				</td>
				<shiro:hasPermission name="cms:video:edit"><td>
    				<a href="${ctx}/cms/video/form?id=${video.id}">修改</a>
					<a href="${ctx}/cms/video/delete?id=${video.id}" onclick="return confirmx('确认要删除该视频吗？', this.href)">删除</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>